<template>
  <view>
    <text class="component-title">子组件A</text>
    <view class="value-card">
      <text class="value-label">父组件传进来的值:</text>
      <text class="value-content" :class="{ 'text-red': intent }">{{ intent || '暂无' }}</text>
    </view>
    <button class="btn-primary" @click="sendData" :disabled="!intent">传值给ComB</button>
  </view>
</template>

<script>
export default {
  props: ['intent'],
  methods: {
    sendData() {
      uni.$emit('getIntent', this.intent);
    }
  }
}
</script>

<style scoped>
.component-title {
  font-size: 36rpx;
  font-weight: bold;
  color: #333;
  display: block;
  margin-bottom: 20rpx;
}
.value-card {
  background: #f5f5f5;
  border-radius: 8rpx;
  padding: 20rpx;
  margin-bottom: 20rpx;
}
.value-label {
  font-size: 28rpx;
  color: #333;
  display: block;
  margin-bottom: 10rpx;
}
.value-content {
  font-size: 30rpx;
  color: #666;
}
.text-red {
  color: red;
  font-weight: bold;
}
.btn-primary {
  background: #007AFF;
  color: #fff;
  height: 80rpx;
  line-height: 80rpx;
  border-radius: 8rpx;
  font-size: 28rpx;
  width: 200rpx;
}
</style>